Overview

The Automated Quantification Pipeline presented below is written in R version 3.6.3 with the following package dependencies:

Bioconductor::EBImage
stringr
shiny
shinyFiles
shinyjs
shinythemes
tidyr

The user supplies the following criteria:

Pipeline

Format conversion

If necessary, files can be converted from .nd2 to .tif files using FIJI’s built in “Batch Convert” macro.

I/O

Tif files are read in and stored in an N x 2 matrix of the form

\[ \left[ \begin{matrix} \text{Image 1 Filename} & \text{Image 1 Filepath} \\ \vdots & \vdots \\ \text{Image N Filename} & \text{Image N Filepath} \end{matrix} \right] \]

where N = number of files. The rows (images) are processed in sequential order.

Image Preprocessing

A local channel object stores information about the channels of the image using the user-supplied channel ordering. For each channel, two image matrices are stored:

  • Matrix of original pixel intensities of the channel, used for quantification

  • Matrix of normalized pixel intensities of the channel, used for image manipulation and rendering

All normalized channels are then converted to grayscale.

Top Row: Image channels (normalized). Bottom Row: Channels converted to grayscale.

Membrane Detection

First pass membrane detection is then initiated on the user-supplied channel. This can be either the GFP channel (ideal for cells with sufficient fluorescence at the cell membrane) or the DIC channel (necessary when intracellular fluroescence is high with low localization at the cell membrane). The detection channel is brightened by a user-supplied factor and the brightened image is passed through a low-pass Gaussian filter. A simple threshold is performed and noise is removed using the user-supplied cell size cutoff. Any remaining membrane object that intersects with the boundaries of the image is then removed. The remaining membrane objects constitute the set of first pass plasma membrane objects, which will be passed to the next stage of the pipeline. A number of features are computed on this set using the reference of the detection channel image, including mean pixel intensity, minimum cell radius, xy coordinates, and area.

Left: All membrane objects detected on the first pass. Middle: Noise (red) and edge membranes (blue). Right: Remaining membrane objects after removal.

Vacuoles

Vacuoles are detected using adaptive thresholding on the CMAC channel. The adaptive window has a length and width equal to the largest minimum radius of any membrane object in the first-pass set. The mean pixel intensity, xy coordinates, and area are computed on each detected vacuole object using the reference CMAC channel.

Left: Grayscale CMAC channel with adaptive window.  Right: First-pass vacuole objects.

Left: Grayscale CMAC channel with adaptive window. Right: First-pass vacuole objects.

Filtering

The first-pass sets of the membrane and vacuole objects are then sent to a filtering method, where they are used in combination to exclude the cases outlined below. Each membrane object from the first-pass set is processed individually.

Fragments

A floodFill operation is performed on the PM object and the result is temporarily stored. If only a portion of the membrane is present, the floodFilled object will be identical to the original object. This comparison serves as the exclusionary criteria for fragmented objects. There is a 10 pixel margin to allow for membrane objects that are fully formed but have very minor gaps in fluorescence.

Example of a fragmented membrane object.

Intracellular Fluorescence

The floodFilled object is again used, this time as a mask applied to the set of first-pass vacuole objects. The result of this operation is a set of all vacuoles contained within the cell. The majority of intracellular fluorescence erroneously detected as a membrane object will intersect with the set of contained vacuoled and be marked for exclusion. Additionally, this method will exclude any detected vacuole object that intersects with the cell membrane.

Example of intracellcular fluorescence (red) intersecting with contained vacuoles (blue).

Empty cells

The method above may miss intracellular fluorescence that does not intersect with any contained vacuole. Those cases will be handled here, where any cell with a vacuole list of length 0 is excluded. This not only covers the case above but also cells that do not contain vacuoles at all.

Example of an empty cell.

From left to right: First-pass vacuole detection, Objects flagged by the filtering method, Removal of flagged objects, Remaining set of membranes and vacuoles.

Output

The final membrane and vacuole objects are re-enumerated and stored in a dataframe, with each row containing a cell ID, vacuole ID, area of the cell membrane, combined area of the vacuole objects, the mean PM fluorescence, the mean vacuole fluorescence, and the PM/vac fluorescence ratio. The dataframe is saved as a .csv file and an image is generated with the final membrane and vacuole objects painted on the GFP channel along with their CellID numbers.

##    CellID vacuoles cell_area vac_area PM_vac_ratio  cell_mpi   vac_mpi
## 1       1       71      1233      839    1.0733871  3167.281  2950.735
## 2       2       72      1924     1093    1.1495331 11936.063 10383.401
## 3       3       73      1816     1745    0.6650048 17076.768 25679.165
## 4       4       74      4180     3675    1.4021632 30337.457 21636.181
## 5       5       75      3759     1849    1.4546703  6495.020  4464.943
## 6       6       76      1488      513    1.0004946 18208.003 18199.001
## 7       7       77      2508     1238    0.8057825 13782.763 17104.817
## 8       8       78      2296     1522    1.4770360 11220.335  7596.521
## 9       9       79      1767       83    1.1283229  5213.713  4620.763
## 10     10       80      1565       93    1.2149618  4193.431  3451.492
## 11     11       81      3309     1193    1.3354997 10300.851  7713.106
## 12     12       82      2340      602    0.5591493 12568.159 22477.288
## 13     13       83      1334      236    1.3485684  7327.013  5433.179
## 14     14       84      1177      173    1.0083879  4969.091  4927.757
## 15     15       85      1276      779    0.8992214  5952.255  6619.343
## 16     16       86      1558       65    1.2865355 12416.901  9651.425
## 17     17       87      2912      605    1.1338535  9505.297  8383.179
## 18     18       88      1777      422    0.9998796  6484.093  6484.874
## 19     19       89      1213      400    0.9840989  5201.938  5285.991
## 20     20       90      1581      368    1.2431656 13720.981 11037.130
## 21     21       91      1939     1289    1.0112522 20714.872 20484.377
## 22     22       92      1760      736    1.1761712 22107.417 18796.087
## 23     23       93      2646      419    1.3579561  3609.252  2657.856
## 24     24       94      1306      257    1.0391366  6463.030  6219.615
## 25     25       95      1629     1086    1.2914826 15066.692 11666.198
## 26     26       96      3545      688    1.2570884  5141.995  4090.400
## 27     27       97      1922      452    0.8550045 17205.271 20123.017
## 28     28       98      3770     1217    1.4622938 21440.715 14662.385
## 29     29       99      1583      591    1.3027545  4007.932  3076.506
## 30     30      100      3998      232    1.4073658  8379.805  5954.248
## 31     31      101      2033      336    0.9113482 14149.856 15526.289
## 32     32      102      3430      952    1.3640301 12389.790  9083.224
## 33     33      103      2719      702    1.4112806  7093.129  5026.023
## 34     34      104      1230      216    1.3807442  8370.795  6062.524
## 35     35      105      2773     1069    1.3521639  7394.819  5468.877
## 36     36      106      1601      415    1.4401723 10473.943  7272.701
## 37     37      107      6378     2956    1.2768691 11155.743  8736.795
## 38     38      108      3191     1343    1.3018884 10476.186  8046.916
## 39     39      109      1424      740    1.2874784  5665.393  4400.379
## 40     40      110      2928      946    1.1171992  5560.853  4977.495
## 41     41      111      2254     1742    0.7877115 20643.065 26206.378
## 42     42      112      1557       33    1.2687040  6086.247  4797.216
## 43     43      113      1351      448    1.1912426 12974.359 10891.450
## 44     44      114      2213     2068    1.3681385  6437.525  4705.317
## 45     45      115      1787      983    1.3279274 23968.639 18049.660
## 46     46      116      2008      695    1.3422452  7689.023  5728.479
## 47     47      117      3376      596    1.1520454  9198.035  7984.091
## 48     48      118      4017     1041    1.2037811  7622.280  6331.949
## 49     49      119      1533      186    1.1703423  4168.797  3562.032
## 50     50      120      1969      559    1.4072670  7670.244  5450.454
## 51     51      121      1285      538    1.2409410  6220.888  5013.041
## 52     52      122      1871      897    1.2484873 18668.592 14952.969
## 53     53      123      3265      697    1.3560479  7337.144  5410.682
## 54     54      124      2359      492    1.2199478  3884.601  3184.236
## 55     55      125      2954      601    1.2446836  8853.281  7112.877
## 56     56      126      2351     1368    1.1384201 15191.330 13344.221
## 57     57      127      2263      636    1.2388731 30969.596 24998.198
## 58     58      128      2907      315    1.0582392  8169.367  7719.773
## 59     59      129      1726     1081    1.3909237 11803.911  8486.383
## 60     60      130      1174       72    1.2182458  3857.880  3166.750
## 61     61      131      1707     1335    1.2129796 15660.351 12910.647
## 62     62      132      1898     1275    1.1789298 11863.823 10063.215
## 63     63      133      1491      885    1.0717457 12914.699 12050.153
## 64     64      134      1806      927    1.0167733  8221.969  8086.334
## 65     65      135      3407      744    1.1150131  4565.385  4094.468
## 66     66      136      1248      384    1.2566517  5727.023  4557.367
## 67     67      137      2056     2161    0.9943824 28207.724 28367.078
## 68     68      138      1620      687    1.0907283  5166.684  4736.912
## 69     69      139      1812      185    1.0884341  6757.802  6208.738
## 70     70      140      1229       48    1.0017905  3577.600  3571.206
##    pm_center_x pm_center_y
## 1   1839.47283    40.68938
## 2   2001.39241   107.52703
## 3    936.92952   133.27863
## 4   1125.53947   144.75431
## 5    122.63102   205.29875
## 6   1129.19153   233.71438
## 7   1894.28828   332.20893
## 8    159.95906   375.35801
## 9    327.20204   372.15054
## 10   412.14888   376.64281
## 11  1444.36174   422.98187
## 12  1885.04658   445.95513
## 13   112.46327   452.77286
## 14  1529.10025   497.65506
## 15  1363.23511   522.80172
## 16   101.60205   540.63864
## 17   441.41930   573.03400
## 18  1578.28644   559.62577
## 19  1498.53669   565.75845
## 20  1148.32068   567.97090
## 21   913.33935   599.34451
## 22  1073.85114   608.93068
## 23   607.86281   630.44369
## 24  1329.29479   640.67841
## 25  1278.11909   696.90546
## 26   187.59887   712.94669
## 27   929.92924   705.88814
## 28  1520.89814   733.22255
## 29   567.40303   719.69867
## 30  1770.13557   769.39045
## 31  1431.23856   821.60108
## 32  1230.94227   846.72187
## 33   318.67929   877.23648
## 34  1708.70163   884.91545
## 35  1494.13884   906.27479
## 36  1636.01187   918.12617
## 37  1097.66949  1033.79523
## 38  1786.84080  1107.20777
## 39   328.82514  1069.89396
## 40   195.06113  1122.04918
## 41   589.14862  1143.17968
## 42   761.40270  1129.58638
## 43  1524.89193  1127.53146
## 44   364.23769  1163.26570
## 45  1646.99552  1175.12535
## 46   181.13098  1227.32719
## 47  1494.10989  1246.17150
## 48  1145.99178  1287.65970
## 49   308.80887  1268.19830
## 50   198.76638  1329.58304
## 51  1888.02101  1346.68949
## 52    72.65473  1395.76750
## 53  1281.52894  1475.26830
## 54  1158.38830  1514.79822
## 55  1388.19702  1549.45362
## 56  1005.37133  1672.10336
## 57   292.97304  1706.15024
## 58  1446.99931  1754.01066
## 59   885.64253  1748.90672
## 60  1796.28876  1832.62692
## 61   439.56298  1845.28530
## 62   739.04215  1868.63330
## 63   162.39235  1869.79007
## 64  1263.86047  1897.31451
## 65  1807.07103  1941.60845
## 66  1489.87740  1924.56330
## 67  1401.20379  1964.03599
## 68   231.62407  1965.37593
## 69  1228.95309  1981.95751
## 70   316.80065  1980.31489